package io.renren.msg.server;

import io.renren.msg.Const;
import io.renren.msg.HelloPacket;
import org.tio.server.AioServer;
import org.tio.server.ServerGroupContext;
import org.tio.server.intf.ServerAioHandler;
import org.tio.server.intf.ServerAioListener;

import java.io.IOException;

/**
 * Created by kun on 2017/5/2.
 */
public class HelloServerStarter {
    //handler,包括编码,解码,消息处理
    public static ServerAioHandler<Object,HelloPacket,Object> aioHandler=new HelloServerAioHandler();
    public static ServerAioListener<Object,HelloPacket,Object> aioListener=null;
    public static ServerGroupContext<Object,HelloPacket,Object> serverGroupContext=new ServerGroupContext<Object, HelloPacket, Object>(aioHandler,aioListener);

    public static AioServer<Object,HelloPacket,Object> aioServer=new AioServer<>(serverGroupContext);

    public static String serverIP= null;
    public static int serverPort= Const.PORT;

    public static void main(String args[]) throws IOException {
        aioServer.start(serverIP,serverPort);
    }
}
